#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

class Solution {
    public:
	vector<int> getMaxMatrix(vector<vector<int>> &matrix)
	{
                int n = matrix.size(), m = matrix[0].size();
                vector<int> sum(m, 0);

                int lu_row, lu_col, rd_row, rd_col, msum = INT32_MIN;
                for(int i = 0; i < n; i++){
                        fill(sum.begin(), sum.end(), 0);
                        for(int j = i; j < n; j++){
                                for(int l = 0, r = 0, pre = INT32_MIN; r < m; r++){
                                        sum[r] += matrix[j][r];
                                        if(pre >= 0){
                                                pre += sum[r];
                                        }else{
                                                l = r;
                                                pre = sum[r];
                                        }
                                        if(pre > msum){
                                                msum = pre;
                                                lu_row = i;
                                                lu_col = l;
                                                rd_row = j;
                                                rd_col = r;
                                        }
                                }
                        }
                }
                return {lu_row, lu_col, rd_row, rd_col};
	}
};

int main()
{
	vector<vector<int>> matrix = { { -1, 0 }, { 0, -1 } };
	vector<int> pos =  Solution().getMaxMatrix(matrix);
        cout<<"["<<pos[0]<<","<<pos[1]<<","<<pos[2]<<","<<pos[3]<<"]"<<endl;
	return 0;
}
